#include "number.h"

Complex* complex_round (Complex* complex)
{
    Interval* re = interval_round(complex->re);
    Interval* im = interval_round(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_c_c (Complex* complex)
{
    Interval* re = interval_round_ceiling(complex->re);
    Interval* im = interval_round_ceiling(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_c_f (Complex* complex)
{
    Interval* re = interval_round_ceiling(complex->re);
    Interval* im = interval_round_floor(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_f_c (Complex* complex)
{
    Interval* re = interval_round_floor(complex->re);
    Interval* im = interval_round_ceiling(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_f_f (Complex* complex)
{
    Interval* re = interval_round_floor(complex->re);
    Interval* im = interval_round_floor(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_i_i (Complex* complex)
{
    Interval* re = interval_round_infinity(complex->re);
    Interval* im = interval_round_infinity(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_i_o (Complex* complex)
{
    Interval* re = interval_round_infinity(complex->re);
    Interval* im = interval_round_origin(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_o_i (Complex* complex)
{
    Interval* re = interval_round_origin(complex->re);
    Interval* im = interval_round_infinity(complex->im);
    
    return complex_new(re, im);
}

Complex* complex_round_o_o (Complex* complex)
{
    Interval* re = interval_round_origin(complex->re);
    Interval* im = interval_round_origin(complex->im);
    
    return complex_new(re, im);
}
